package com.wd.health.utils;



import android.database.Observable;

import com.tencent.mm.opensdk.modelmsg.SendAuth;
import com.wd.health.model.api.Api;
import com.wd.health.model.bean.BannerBean;
import com.wd.health.model.bean.BarrageBean;
import com.wd.health.model.bean.ByqBean;
import com.wd.health.model.bean.ByqxqBean;
import com.wd.health.model.bean.BzxqBean;
import com.wd.health.model.bean.CyypBean;
import com.wd.health.model.bean.CyypBean02;
import com.wd.health.model.bean.DanMuBean;
import com.wd.health.model.bean.DoctorBean;
import com.wd.health.model.bean.DqwzBean;
import com.wd.health.model.bean.FaceLoginBean;
import com.wd.health.model.bean.HealthJtBean;
import com.wd.health.model.bean.HistoryMoneyBean;
import com.wd.health.model.bean.HistoryWzBean;
import com.wd.health.model.bean.JkzxBean01;
import com.wd.health.model.bean.CjbzBean02;
import com.wd.health.model.bean.KslbBean;
import com.wd.health.model.bean.LoginBean;
import com.wd.health.model.bean.LswzBean;
import com.wd.health.model.bean.MessageStatusBean;
import com.wd.health.model.bean.MoneyBean;
import com.wd.health.model.bean.PopularBean;
import com.wd.health.model.bean.RegisterBean;
import com.wd.health.model.bean.SearchBean;
import com.wd.health.model.bean.SendMessageBean;
import com.wd.health.model.bean.SfSignInBean;
import com.wd.health.model.bean.SignInBean;
import com.wd.health.model.bean.StopBean;
import com.wd.health.model.bean.TalkBean;
import com.wd.health.model.bean.UpdatePwdBean;
import com.wd.health.model.bean.UploadAvaterBean;
import com.wd.health.model.bean.UserTaskBean;
import com.wd.health.model.bean.VideoInfoBean;
import com.wd.health.model.bean.WXzhifuBean;
import com.wd.health.model.bean.WxLoginBean;
import com.wd.health.model.bean.WzysBean;
import com.wd.health.model.bean.YpxqBean;
import com.wd.health.model.bean.YqmBean;
import com.wd.health.model.bean.ZfbBean;
import com.wd.health.model.bean.ZixunBean;
import com.wd.health.model.bean.ZixunyishengBean;
import com.wd.health.model.bean.ZxxqBean;

import java.io.File;

import io.reactivex.Observable;

import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Query;


/**
 * Retrofit默认只使用这一个IApi
 * <p>
 * <p>
 * 使用规范：
 * 一个http请求对应该接口中一个方法
 */
public interface ApiService {
    //注册
    @Headers({"Content-type:application/x-www-form-urlencoded"})
    @POST(Api.REGISTER_URL)
    Observable<RegisterBean> RegisterData(@Query("email") String email, @Query("code") String code, @Query("pwd1") String pwd1, @Query("pwd2") String pwd2);
    //登录
    @Headers({"Content-type:application/x-www-form-urlencoded"})
    @POST(Api.LOGIN_URL)
    Observable<LoginBean> LoginData(@Query("email") String email, @Query("pwd") String pwd);
    //发送邮箱验证码
    @POST(Api.EMAIL_URL)
    Observable<RegisterBean> getEmailData(@Query("email") String email);
    //Banner
    @GET(Api.BANNER_URL)
    Observable<BannerBean> getBannerData();
    //科室列表
    @GET(Api.CHAXUNKESHI_URL)
    Observable<KslbBean> getKszx();
    //健康资讯一级条目
    @GET(Api.JIANKANGZIXUN_URL)
    Observable<JkzxBean01> getJkzxData();
    //常用药品一级列表
    @GET(Api.YAOPINLEIMU_URL)
    Observable<CyypBean> getCyypData();
    //常见病症二级列表
    @GET(Api.CHAXUNBINGZHENG_URL)
    Observable<CjbzBean02> getJkzxData02(@Query("departmentId") int departmentId);
    //常见药品二级列表
    @GET(Api.YAOPINERJI_URL)
    Observable<CyypBean02> getCyypData02(@Query("drugsCategoryId") int drugsCategoryId, @Query("page") int page, @Query("count") int count);
    //资讯列表
    @GET(Api.ZIXUNMOKUAI_URL)
    Observable<ZixunBean> getZiXunData(@Query("plateId") int plateId, @Query("page") int page, @Query("count") int count);
    //常见病症详情
    @GET(Api.CHANGJIANBINGZHENG_URL)
    Observable<BzxqBean> getBzxqData(@Query("id") int id);
    //药品详情
    @GET(Api.CHANGJIANYAOPIN_URL)
    Observable<YpxqBean> getYpxqData(@Query("id") int id);
    //搜索
    @GET(Api.HOMESOUSUO_URL)
    Observable<SearchBean> getSearchData(@Query("keyWord") String keyWord);
    //热门搜索
    @GET(Api.REMENSOUSUO_URL)
    Observable<PopularBean> getPopData();
    //问诊医生列表
    @GET(Api.WENZHENYISHENG_URL)
    Observable<WzysBean> getWzysData(@Query("deptId") int deptId, @Query("condition") int condition, @Query("page") int page, @Query("count") int count);
    //咨询详情
    @GET(Api.ZIXUNXIANGQING_URL)
    Observable<ZxxqBean> getZxxqData(@Query("infoId") int infoId);
    //病友圈
    @GET(Api.BINGYOUQUAN_URL)
    Observable<ByqBean> getByqData(@Query("departmentId") int departmentId, @Query("page") int page, @Query("count") int count);
    //病友圈详情
    @GET(Api.BINGYOUQUANXIANGQING_URL)
    Observable<ByqxqBean> getByqxqData(@Query("sickCircleId") int sickCircleId);
    //医生明细
    @GET(Api.DOCTOR_URL)
    Observable<DoctorBean> getDoctorData(@Query("doctorId") int doctorId);
    //咨询医生
    @PUT(Api.ZIXUN_URL)
    Observable<ZixunyishengBean> putZixunData(@Query("doctorId") int doctorId);
    //发送消息
    @POST(Api.FASONG_URL)
    Observable<SendMessageBean> postSendData(@Query("inquiryId") int inquiryId, @Query("content") String content, @Query("type") int type, @Query("doctorId") int doctorId);
    //当前问诊
    @GET(Api.DQWENZHEN_URL)
    Observable<DqwzBean> getDqwzData();
    //结束问诊
    @PUT(Api.STOPWENZHEN_URL)
    Observable<StopBean> putStopWzData(@Query("recordId") int recordId);
    //查询历史消息记录
    @GET(Api.TALK_URL)
    Observable<TalkBean> getTalkData(@Query("inquiryId") int inquiryId, @Query("page") int page, @Query("count") int count);
    //查看历史问诊
    @GET(Api.HISTROY_URL)
    Observable<LswzBean> getHistroyData(@Query("page") int page, @Query("count") int count);
    //根据视频类目查询视频列表
    @GET(Api.VIDEOINFO_URL)
    Observable<VideoInfoBean> getVideoInfoData(@Query("categoryId") int categoryId, @Query("page") int page, @Query("count") int count);
      //我的钱包
    @GET(Api.MONEY_URL)
    Observable<MoneyBean> getMoneyData();
    //微信支付
    @POST(Api.WXZHIFU_URL)
    Observable<WXzhifuBean> postWXzhifu(@Query("money") double money, @Query("payType") int payType);
    //查询健康讲堂类目
    @GET(Api.HEALTHJT_URL)
    Observable<HealthJtBean> getHealthjtData();
    //查询视频评论（弹幕）
    @GET(Api.DANMU_URL)
    Observable<DanMuBean> getDanMuData(@Query("videoId") int videoId);
    //用户查看历史问诊
    @GET(Api.HISTORYWENZHEN_URL)
    Observable<HistoryWzBean> getHistorywenzhenData(@Query("page") int page, @Query("count") int count);
    //查看消费记录
    @GET(Api.HISTORYMONEY_URL)
    Observable<HistoryMoneyBean> getHistoryMoneyData(@Query("page") int page, @Query("count") int count);
    //用户签到
    @POST(Api.SIGNIN_URL)
    Observable<SignInBean> postSigninData();
    //查看用户当天是否签到
    @GET(Api.SFSIGNIN_URL)
    Observable<SfSignInBean> getSignInData();
    //查询用户任务列表
    @GET(Api.USERTASKLIST_URL)
    Observable<UserTaskBean> getUserTaskListData();
    //微信登录
    @POST(Api.WXLOGIN_URL)
    Observable<WxLoginBean> postWxLoginData(@Query("wxCode") String wxCode);
    //上传头像
    @POST(Api.UPLOADAVATAR_URL)
    Observable<UploadAvaterBean> postAvaterData(@Query("image") File image);
    //修改密码
    @PUT(Api.UPDATEPWD_URL)
    Observable<UpdatePwdBean> putUpdatePwdData(@Query("oldPwd") String oldPwd, @Query("newPwd") String newPwd);
    //支付宝支付
    @POST(Api.ZFB_URL)
    Observable<ZfbBean> postZfbData(@Query("money") double money, @Query("payType") int payType);
    //完善邮箱
    @PUT(Api.PERFECTMAIL)
    Observable<MessageStatusBean> putMailData(@Query("email") String email);
    //生成邀请码
    @POST(Api.YAOQINGMA)
    Observable<MessageStatusBean> postYQMData();
    //查询用户邀请码
    @GET(Api.YHYAOQINGMA)
    Observable<YqmBean> getYHYQMData();
    //绑定人脸
    @Headers({"Content-type:application/json;charset=UTF-8"})
    @POST(Api.FACE_URL)
    Observable<MessageStatusBean> postFaceData(@Body RequestBody requestBody);
    //绑定身份证
    @POST(Api.BADNGINDSHENFENZHENG)
    Observable<MessageStatusBean> postSfzData(@Body RequestBody requestBody);
    //绑定银行卡
    @POST(Api.BANGDINGYINHANGKA)
    Observable<MessageStatusBean> postYhkData(@Query("bankCardNumber") String bankCardNumber, @Query("bankName") String bankName, @Query("bankCardType") int bankCardType);
    //人脸登录
    @POST(Api.FACELOGIN)
    Observable<FaceLoginBean> postFaceLoginData(@Query("faceImage") String faceImage);
    //弹幕
    @GET(Api.BARRAGE)
    Observable<BarrageBean> getBarrageData(@Query("videoId") int videoId);
}
